package com.wty.gw.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wty.gw.util.PageParamReq;
import com.wty.gw.dao.CommonHrefMapper;
import com.wty.gw.model.Do.CommonHrefDO;
import com.wty.gw.model.query.CommonHrefQuery;
import com.wty.gw.service.CommonHrefService;
import com.wty.gw.model.vo.CommonHrefVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class CommonHrefServiceImpl implements CommonHrefService{

	@Autowired
    private CommonHrefMapper commonHrefMapper;

    @Override
    public void add(CommonHrefDO commonHrefDo) {
        commonHrefMapper.insert(commonHrefDo);
    }

    @Override
    public void delete(Long id) {
        commonHrefMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(CommonHrefDO commonHrefDo) {
        commonHrefMapper.updateByPrimaryKeySelective(commonHrefDo);
    }

    @Override
    public PageInfo<CommonHrefVo> listByPage(CommonHrefQuery commonHrefQuery) {
        PageHelper.startPage(commonHrefQuery.getPageNo(), commonHrefQuery.getPageSize());

        return new PageInfo(commonHrefMapper.listBycompanyId(commonHrefQuery));
    }

    @Override
    public CommonHrefDO get(Long id) {
        return commonHrefMapper.selectByPrimaryKey(id);
    }
	
	
	
	
	
	
}